package com.ndp.fb.enums.targetingspec;

import lombok.Getter;

/**
 * Created by Sisi on 14-11-14.
 */
@Getter
public enum Connections {
    All(0),

    Connections(1),

    Excluded_connections(2);

    private int code;

     Connections(int code) {
        this.code = code;
    }

    /**
     * 根据code获取Connections
     *
     * @param code code
     * @return Connections
     */
    public static Connections getConnections(int code) {
        for (Connections c : Connections.values()) {
            if (c.code == code) {
                return c;
            }
        }
        return null;
    }
}
